/* 整体设置 */
body{
    padding: 20px;
    background-color: white;
}

/* 标题设置 */
h2{
    text-align: center;
}

/* 游戏边框*/
#game{
    width: 75%;
    height: 300px;
    border: 1px solid black;
    margin: 0 auto; 
    display: block; 
    position: relative;
}

/* 玩家 */
#ikun{
    width: 85px;
    height: 160px;
    background-color: rebeccapurple;
    position: absolute;
    bottom: 0px;
}
/* 将跳跃动画放到类中方便接入监听 */
.jumpclass{
    animation: jump 0.3s infinite;
}
/* 给坤坤添加动作 */
@keyframes jump{
    0%{
        bottom: 0px;
    }
    30%{
        bottom: 150px;
    }
    70%{
        bottom: 150px;
    }
    100%{
        bottom: 0px;
    }
}

/* 敌人 */
#blacker{
    position: absolute;
    width: 80px;
    height: 80px;
    background-color: black;
    bottom: 0px;
    left: 850px;
    
    animation: blacker 1s linear infinite;/*将时间调小可以增加难度*/
}
/* 给小黑子添加移动 */
@keyframes blacker{
    0%{
        left: 850px;
    }
    100%{
        left: -20px;
    }

}